package com.alison;

import com.alison.config.TestConfig;
import com.alison.ioc.IOCService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;


public class TestApplication {

	public static void main(String[] args) {
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:application-ioc.xml");
		System.out.println(Arrays.toString(applicationContext.getBeanDefinitionNames()));
		TestConfig testConfig = (TestConfig) applicationContext.getBean("testConfig");
		System.out.println(testConfig.getUsername());
		IOCService iocService = applicationContext.getBean(IOCService.class);
		System.out.println(iocService.hello());
		System.out.println("哈哈哈哈");
	}
}
